<?php
class Migration_Create_Messages_Privates extends CI_Migration {
	
	private $table = 'messages_privates';
	
	
	public function up() {
		$obj = $this->dbforge;
		$fields = array (
				'ID' => array (
						'type' => 'int',
						'unsigned' => true,
						'auto_increment' => true,
						'null' => false,
						'constraint' => 11 
				),
				'USER_ID' => array (
						'type' => 'INT',
						'constraint' => '11',
						'null'=>false 
				),
                                'SENDING' => array (
						'type' => 'VARCHAR',
                                                'constraint' => '50',
						'null'=>false 
				),
                               'RECIPIENT' => array (
						'type' => 'VARCHAR',
						'constraint' => '50',
                                              'null'=>false 
				),
                                'MESSAGE' => array (
						'type' => 'TEXT',
                                                
						'null'=>false 
				),
				'LOADED' => array (
						'type' => 'CHAR',
						'constraint' => '1',
                                                'default'=>'N',
						'null'=>false
						
				),
				'DELETED' => array (
						'type' => 'CHAR',
						'constraint' => '1',
                                                'default'=>'N',
						'null'=>false
				
				)
				
		);
		$obj->add_key ('ID', true );
		$obj->add_field ( $fields );
		$obj->create_table ($this->table, TRUE );
		
		
		
	}
	public function down() {
		$this->dbforge->drop_table ($this->table );
	}
}
